#include <iostream>
#include <vector>
#include <queue>
#include <functional>

// void func()
// {
//     std::cout << "Hello World" << std::endl;
// }

class A
{
public:
    static int func()
    {
        int ret = n;
        n = (n + 1) % 2;
        return ret;
    }

    int operator[](const int index)
    {
        return arr[index];
    }

    int Xmax(int cnt)
    {
        std::priority_queue<int, std::vector<int>, std::greater<int>> pq;
        // std::priority_queue<int> pq;
        for (int i = 0; i < arr.size(); ++i)
        {
            if (pq.size() < cnt) { pq.push(arr[i]); }
            else {
                if (pq.top() < arr[i])
                {
                    pq.pop();
                    pq.push(arr[i]);
                }
            }
        }
        return pq.top();
    }

    void push(std::vector<int> vec)
    {
        for (auto num : vec) {
            arr.push_back(num);
        }
    }

    A& operator+=(A other)
    {
        int curI = 0, otherI = 0;
        while (curI < arr.size() && otherI < other.arr.size()) {
            arr[curI] = arr[curI] + (other.arr)[otherI];
            ++curI; ++otherI;
        }
        return *this;
    }

    void Test()
    {
        for (auto num : arr) {
            std::cout << num << std::endl;
        }
    }

private:
    static int n;
    std::vector<int> arr;
};

int A::n = 0;